﻿<UserControl x:Class="myManga.Views.AboutView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:my="clr-namespace:myManga.UI"
             xmlns:bakabox="clr-namespace:System.Windows.Controls;assembly=BakaBox"
             Background="Black"
             Foreground="White"
             FontFamily="Segoe UI"
             Padding="3"
             TextElement.Foreground="White">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <StackPanel>
            <bakabox:BalancedWrapPanel>
                <TextBlock
                FontSize="16">
                <TextBlock.Text>
                    <MultiBinding StringFormat="{}{0} {1}">
                        <Binding Path="AssemblyTitle"/>
                        <Binding Path="AssemblyVersion"/>
                    </MultiBinding>
                </TextBlock.Text>
                </TextBlock>
                <TextBlock Text="{Binding Path=AssemblyCopyright}" FontSize="14"/>
            </bakabox:BalancedWrapPanel>
            <HeaderedContentControl Header="Icon Sources" Margin="3,5">
                <bakabox:BalancedWrapPanel>
                    <TextBlock Margin="5,2">
                        <Hyperlink Foreground="White" FontWeight="Bold" NavigateUri="http://www.iconsforwindows8.com/" RequestNavigate="Hyperlink_RequestNavigate">iconsforwindows8</Hyperlink>
                    </TextBlock>
                    <TextBlock Margin="5,2">
                        <Hyperlink Foreground="White" FontWeight="Bold" NavigateUri="http://metro.windowswiki.info/" RequestNavigate="Hyperlink_RequestNavigate">metro.windowswiki.info</Hyperlink>
                    </TextBlock>
                </bakabox:BalancedWrapPanel>
            </HeaderedContentControl>
        </StackPanel>
        <Grid Margin="5,2" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Image Source="/myManga;component/Resources/Icon.ico" Height="32" Grid.Column="0"/>
            <TextBlock Margin="5,0" TextWrapping="Wrap" Grid.Column="1">
                            <Span>The Logo and Icon has been designed by
                                '<Span FontStyle="Italic">William Barnard</Span>'
                                find his work on 
                                <Hyperlink Foreground="White" FontWeight="Bold" NavigateUri="http://bluedudowill.deviantart.com/" RequestNavigate="Hyperlink_RequestNavigate">
                                    DeviantArt
                                </Hyperlink>.
                            </Span>
            </TextBlock>
        </Grid>
        <Grid Grid.Row="2" Height="132">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Border>
                <Image Source="/myManga;component/Resources/Images/john%20parks.png"/>
            </Border>
            <HeaderedContentControl Grid.Column="1" Header="About Author" Padding="4">
                <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                    <StackPanel>
                        <TextBlock Text="Name: James Parks"/>
                        <TextBlock Padding="10,0,0,0" Text="AKA: Prob Caboose"/>
                        <TextBlock Text="Location: USA"/>
                        <TextBlock Text="Why was this application made?"/>
                        <TextBlock Padding="10,0,0,0" TextWrapping="Wrap">
                            No other application was found that could do what I wanted.
                            More about this topic can be found <Hyperlink Foreground="White" FontWeight="Bold" NavigateUri="http://mymanga.codeplex.com/#About" RequestNavigate="Hyperlink_RequestNavigate">here</Hyperlink>.
                        </TextBlock>
                        <TextBlock TextWrapping="Wrap">
                                More about this project at: <Hyperlink Foreground="White" FontWeight="Bold" NavigateUri="http://mymanga.codeplex.com/" RequestNavigate="Hyperlink_RequestNavigate">http://mymanga.codeplex.com/</Hyperlink>
                        </TextBlock>
                    </StackPanel>
                </ScrollViewer>
            </HeaderedContentControl>
        </Grid>
        <HeaderedContentControl
            Header="Loaded Plugins"
            Grid.Row="3">
            <ListView 
                ItemsSource="{Binding Path=PluginInfoModelCollection}" 
                Grid.Row="1" SelectionMode="Single"
                Background="#252525"
                Foreground="GhostWhite"
                BorderThickness="0"
                Padding="0">
                <ListView.View>
                    <GridView>
                        <GridViewColumn 
                            Header="Name" 
                            CellTemplate="{DynamicResource ResourceKey=NameCellTemplate}"
                            Width="Auto"/>
                        <GridViewColumn 
                            Header="Author" 
                            CellTemplate="{DynamicResource ResourceKey=AuthorCellTemplate}"
                            Width="Auto"/>
                        <GridViewColumn 
                            Header="Supported Methods" 
                            CellTemplate="{DynamicResource ResourceKey=SupportedMethodsCellTemplate}"
                            Width="Auto"/>
                    </GridView>
                </ListView.View>
                <ListView.Resources>
                    <Style x:Key="GridViewColumnHeaderGripper" TargetType="Thumb">
                        <Setter Property="Width" Value="18"/>
                        <Setter Property="Background" Value="#666"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Thumb}">
                                    <Border Padding="{TemplateBinding Padding}" Background="Transparent">
                                        <Rectangle HorizontalAlignment="Center" Width="2" Fill="{TemplateBinding Background}"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="{x:Type GridViewColumnHeader}">
                        <Setter Property="HorizontalContentAlignment" Value="Center"/>
                        <Setter Property="VerticalContentAlignment" Value="Center"/>
                        <Setter Property="Foreground" Value="White" />
                        <Setter Property="Padding" Value="10,1"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                                    <Grid>
                                        <Border 
                                            Name="HeaderBorder" 
                                            Padding="{TemplateBinding Padding}" 
                                            BorderThickness="1,1,0,1" BorderBrush="#777" Background="#333">
                                            <ContentPresenter 
                                                Name="HeaderContent" Margin="0,0,0,1" 
                                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                                RecognizesAccessKey="True" 
                                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                        </Border>
                                        <Thumb 
                                            x:Name="PART_HeaderGripper" 
                                            HorizontalAlignment="Right" 
                                            Margin="0,0,-9,0" 
                                            Style="{StaticResource GridViewColumnHeaderGripper}"/>
                                    </Grid>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>

                    <Style TargetType="{x:Type ListViewItem}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ListViewItem}">
                                    <Border 
                                        x:Name="Bd" 
                                        Background="{TemplateBinding Background}" 
                                        SnapsToDevicePixels="True" BorderThickness="0">
                                        <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>

                    <DataTemplate x:Key="NameCellTemplate">
                        <TextBlock 
                            Text="{Binding Name}" 
                            Foreground="White"
                            TextAlignment="Center"
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center"/>
                    </DataTemplate>
                    <DataTemplate x:Key="AuthorCellTemplate">
                        <TextBlock 
                            Text="{Binding Author}" 
                            Foreground="White"
                            TextAlignment="Center"
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center"/>
                    </DataTemplate>
                    <DataTemplate x:Key="SupportedMethodsCellTemplate">
                        <TextBlock 
                            Text="{Binding SupportedMethods}" 
                            Foreground="White"
                            TextAlignment="Center"
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center"/>
                    </DataTemplate>
                </ListView.Resources>
            </ListView>
        </HeaderedContentControl>
    </Grid>
</UserControl>
